<?php

/**
 * captcha actions.
 *
 * @package    bizcard
 * @subpackage captcha
 * @author     Daniel Levin
 */
class captchaActions extends sfActions
{
  /**
   * Outputs CAPTCHA image
   *
   */
  public function executeImage()
  {
    $this->getResponse()->setContentType('image/jpeg');
    $captcha = new sfCaptcha();
    $captcha->generateImage();
    $this->getUser()->setAttribute('captcha', $captcha->securityCode);
    imagejpeg($captcha->img);
    imageDestroy($captcha->img);
    return sfView::NONE;
  }
}
